/**
 *  @file Vertex.hpp
 *
 *  @date 05.12.2011
 *  @author Thomas Wiemann
 */

#ifndef __Vertex_HPP__
#define __Vertex_HPP__

#include <iostream>
#include <cmath>
#include <stdexcept>
#include <stdio.h>

#include "Global.hpp"

namespace asteroids
{

/**
 * @brief   Vector representation with three floats for OpenGL
 *
 */
template <class T>
class Vertex {
    private:
    protected:
		T m_x, m_y, m_z;
    public:
        /**
         * @brief   The three values of a vector
         */
        

        /**
         * @brief   Construcs a default Vertex object
         */
        Vertex();
        
        /**
         * @brief   Construcs a Vertex object with given values
         * @param x x-value
         * @param y y-value
         * @param z z-value
         */
        Vertex(T x, T y, T z);
        
        /**
         * @brief   Normalize a Vertex
         */
        void normalize();
        
        /**
         * @brief   Defines the vector addition
         * @param vec vector
         * @return vector
         */
        Vertex<T> operator+ (const Vertex<T> vec) const;
        
        /**
         * @brief   Construcs the scalar multiplication
         * @param scale scalar
         * @return vector
         */
        Vertex<T> operator* (const T scale) const;
        
        /**
         * @brief   Defines the access to a Vertex value
         * @param index wanted value
         * @return vectorentry (as a float)
         */
        T operator[] (const int& index) const;
};

}
#endif